package com.house.user.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * Log entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="t_log")

public class Log  implements java.io.Serializable {


    // Fields    

     private Integer logId;
     private User user;
     private String opType;
     private String opContent;
     private Date opTime;


    // Constructors

    /** default constructor */
    public Log() {
    }

    
    /** full constructor */
    public Log(User user, String opType, String opContent, Date opTime) {
        this.user = user;
        this.opType = opType;
        this.opContent = opContent;
        this.opTime = opTime;
    }

   
    // Property accessors
    @Id 
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    
    @Column(name="log_id", unique=true, nullable=false)

    public Integer getLogId() {
        return this.logId;
    }
    
    public void setLogId(Integer logId) {
        this.logId = logId;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="user_id", nullable=false)

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    
    @Column(name="op_type", nullable=false, length=20)

    public String getOpType() {
        return this.opType;
    }
    
    public void setOpType(String opType) {
        this.opType = opType;
    }
    
    @Column(name="op_content", nullable=false, length=200)

    public String getOpContent() {
        return this.opContent;
    }
    
    public void setOpContent(String opContent) {
        this.opContent = opContent;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="op_time", nullable=false, length=10)

    public Date getOpTime() {
        return this.opTime;
    }
    
    public void setOpTime(Date opTime) {
        this.opTime = opTime;
    }
   








}